﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Input;

namespace CPPEI.Coolzon.Designer.Views
{
    public class UICustomCommand
    {
        static UICustomCommand()
        {
            InputGestureCollection inputs = new InputGestureCollection();
            inputs.Add(new KeyGesture(Key.N, ModifierKeys.Control, "Ctrl+N"));
            AddSolution = new RoutedUICommand("新建方案", "NewSolution", typeof(UICustomCommand), inputs);

            inputs = new InputGestureCollection();
            inputs.Add(new KeyGesture(Key.S, ModifierKeys.Control, "Ctrl+S"));
            Save = new RoutedUICommand("保存", "Save", typeof(UICustomCommand), inputs);

            AddScene = new RoutedUICommand("新建场景", "NewScene", typeof(UICustomCommand));
            inputs = new InputGestureCollection();
            inputs.Add(new KeyGesture(Key.O, ModifierKeys.Control, "Ctrl+O"));
            OpenSolution = new RoutedUICommand("打开方案", "OpenSolution", typeof(UICustomCommand), inputs);
            AddFolder = new RoutedUICommand("新建文件夹", "AddFolder", typeof(UICustomCommand));
            AddResource = new RoutedUICommand("新建资源文件", "AddResource", typeof(UICustomCommand));
            AddExisted = new RoutedUICommand("添加已存在文件", "AddExisted", typeof(UICustomCommand));
            CheckOut = new RoutedUICommand("签出", "CheckOut", typeof(UICustomCommand));
            CheckIn = new RoutedUICommand("签入", "CheckIn", typeof(UICustomCommand));
            GetLatestVersion = new RoutedUICommand("获取最新版本", "GetLatestVersion", typeof(UICustomCommand));
            PublishToFileSystem = new RoutedUICommand("发布到文件系统", "PublishToFileSystem", typeof(UICustomCommand));
            PublishToServer = new RoutedUICommand("发布到服务器", "PublishToServer", typeof(UICustomCommand));
            PublishDataSourceToServer = new RoutedUICommand("发布数据源到服务器", "PublishDataSourceToServer", typeof(UICustomCommand));
            PublishDataSourceToFileSystem = new RoutedUICommand("发布数据源到文件系统", "PublishDataSourceToFileSystem", typeof(UICustomCommand));

            inputs = new InputGestureCollection();
            inputs.Add(new KeyGesture(Key.F2, ModifierKeys.None, "F2"));
            Rename = new RoutedUICommand("重命名", "Rename", typeof(UICustomCommand), inputs);
            UndoPendingChanges = new RoutedUICommand("撤销", "UndoPendingChanges", typeof(UICustomCommand));
            
            Delete = new RoutedUICommand("删除", "Delete", typeof(UICustomCommand));

            inputs = new InputGestureCollection();
            inputs.Add(new KeyGesture(Key.Enter, ModifierKeys.Alt, "Alt+Enter"));
            Properties = new RoutedUICommand("属性", "Properties", typeof(UICustomCommand), inputs);

            EditDataSource = new RoutedUICommand("编辑数据源", "EditDataSource", typeof(UICustomCommand));
            DataSourcePreview = new RoutedUICommand("数据源预览", "DataSourcePreview", typeof(UICustomCommand));
            ManageStaticDataSource = new RoutedUICommand("新增静态数据源", "AddStaticDataSource", typeof(UICustomCommand));

            Displayflow = new RoutedUICommand("场景演示顺序", "Displayflow", typeof(UICustomCommand));
            ScriptConfig = new RoutedUICommand("配置脚本", "ScriptConfig", typeof(UICustomCommand));
            ShortcutAction = new RoutedUICommand("自定义操作", "ShortcutAction", typeof(UICustomCommand));
            NewTemplate = new RoutedUICommand("新建模板", "NewTemplate", typeof(UICustomCommand));

            GetSpecificVersion = new RoutedUICommand("获取特定版本", "GetSpecificVersion", typeof(UICustomCommand));
            ViewHistory = new RoutedUICommand("查看历史", "ViewHistory", typeof(UICustomCommand));
            ViewStatus = new RoutedUICommand("查看状态", "ViewStatus", typeof(UICustomCommand));
            SwitchWorkSpace = new RoutedUICommand("切换工作空间", "SwitchWorkSpace", typeof(UICustomCommand));
            CommentsLink = new RoutedUICommand("配置演讲文稿", "CommentsLink", typeof(UICustomCommand));

            inputs = new InputGestureCollection();
            inputs.Add(new KeyGesture(Key.F4, ModifierKeys.Alt, "Alt+F4"));
            Exit = new RoutedUICommand("退出", "Exit", typeof(UICustomCommand), inputs);

            ChangeGridLineType = new RoutedUICommand("变更网格线", "ChangeGridLineType", typeof(UICustomCommand));

            ShowOrHideView = new RoutedUICommand("显示或隐藏视图", "ShowOrHideView", typeof(UICustomCommand));

            About = new RoutedUICommand("关于", "About", typeof(UICustomCommand));

            Test = new RoutedUICommand("Test", "Test", typeof(UICustomCommand));

        }


        [DefaultExecutedClass(typeof(UICustomCommand))]
        public static RoutedUICommand Test { get; set; }
        public static void Executed(object sender, ExecutedRoutedEventArgs e)
        {

        }
        public static void CanExecute(object sender, CanExecuteRoutedEventArgs e)
        {
            e.CanExecute = true;
        }

        [DefaultExecutedClass(typeof(AddSolutionCommand))]
        public static RoutedUICommand AddSolution { get; set; }

        [DefaultExecutedClass(typeof(SaveCommand))]
        public static RoutedUICommand Save { get; set; }

        [DefaultExecutedClass(typeof(AddSceneCommand))]
        public static RoutedUICommand AddScene { get; set; }

        [DefaultExecutedClass(typeof(OpenSolutionCommand))]
        public static RoutedUICommand OpenSolution { get; set; }

        [DefaultExecutedClass(typeof(AddFolderCommand))]
        public static RoutedUICommand AddFolder { get; set; }

        [DefaultExecutedClass(typeof(AddResourceCommand))]
        public static RoutedUICommand AddResource { get; set; }

        [DefaultExecutedClass(typeof(AddExistedCommand))]
        public static RoutedUICommand AddExisted { get; set; }

        [DefaultExecutedClass(typeof(CheckOutCommand))]
        public static RoutedUICommand CheckOut { get; set; }

        [DefaultExecutedClass(typeof(CheckInCommand))]
        public static RoutedUICommand CheckIn { get; set; }

        [DefaultExecutedClass(typeof(GetLatestVersionCommand))]
        public static RoutedUICommand GetLatestVersion { get; set; }

        [DefaultExecutedClass(typeof(PublishToFileSystemCommand))]
        public static RoutedUICommand PublishToFileSystem { get; set; }

        [DefaultExecutedClass(typeof(PublishToServer))]
        public static RoutedUICommand PublishToServer { get; set; }

        [DefaultExecutedClass(typeof(PublishDataSourceToServerCommand))]
        public static RoutedUICommand PublishDataSourceToServer { get; set; }

        [DefaultExecutedClass(typeof(PublishDataSourceToFileSystemCommand))]
        public static RoutedUICommand PublishDataSourceToFileSystem { get; set; }
        

        [DefaultExecutedClass(typeof(RenameCommand))]
        public static RoutedUICommand Rename { get; set; }

        [DefaultExecutedClass(typeof(UndoPendingChangesCommand))]
        public static RoutedUICommand UndoPendingChanges { get; set; }

        [DefaultExecutedClass(typeof(DeleteCommand))]
        public static RoutedUICommand Delete { get; set; }

        [DefaultExecutedClass(typeof(PropertiesCommand))]
        public static RoutedUICommand Properties { get; set; }

        [DefaultExecutedClass(typeof(EditDataSourceCommand))]
        public static RoutedUICommand EditDataSource { get; set; }

        [DefaultExecutedClass(typeof(DataSourcePreviewCommand))]
        public static RoutedUICommand DataSourcePreview { get; set; }

        [DefaultExecutedClass(typeof(DisplayflowCommand))]
        public static RoutedUICommand Displayflow { get; set; }

        [DefaultExecutedClass(typeof(NewTemplateCommand))]
        public static RoutedUICommand NewTemplate { get; set; }

        [DefaultExecutedClass(typeof(GetSpecificVersionCommand))]
        public static RoutedUICommand GetSpecificVersion { get; set; }

        [DefaultExecutedClass(typeof(ViewHistoryCommand))]
        public static RoutedUICommand ViewHistory { get; set; }

        [DefaultExecutedClass(typeof(ViewStatusCommand))]
        public static RoutedUICommand ViewStatus { get; set; }

        [DefaultExecutedClass(typeof(SwitchWorkSpaceCommand))]
        public static RoutedUICommand SwitchWorkSpace { get; set; }

        [DefaultExecutedClass(typeof(ExitCommand))]
        public static RoutedUICommand Exit { get; set; }

        [DefaultExecutedClass(typeof(ScriptConfigCommand))]
        public static RoutedUICommand ScriptConfig { get; set; }

        [DefaultExecutedClass(typeof(ShortcutActionCommand))]
        public static RoutedUICommand ShortcutAction { get; set; }

        [DefaultExecutedClass(typeof(CommentsLinkCommand))]
        public static RoutedUICommand CommentsLink { get; set; }

        [DefaultExecutedClass(typeof(ChangeGridLineTypeCommand))]
        public static RoutedUICommand ChangeGridLineType { get; set; }

        [DefaultExecutedClass(typeof(ShowOrHideViewCommand))]
        public static RoutedUICommand ShowOrHideView { get; set; }

        [DefaultExecutedClass(typeof(ManageStaticDataSourceCommand))]
        public static RoutedUICommand ManageStaticDataSource { get; set; }

        [DefaultExecutedClass(typeof(AboutCommand))]
        public static RoutedUICommand About { get; set; }
    }
}
